package com.codeoss.module.res.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.codeoss.framework.service.impl.BaseService;
import com.codeoss.module.res.dao.ResRelRoleOrgMapper;
import com.codeoss.module.res.model.ResRelRoleOrg;
import com.codeoss.module.res.service.IResRelRoleOrgService;

@Service
public class ResRelRoleOrgService extends BaseService<ResRelRoleOrgMapper, ResRelRoleOrg>
		implements IResRelRoleOrgService {

	@Override
	public List<Long> getOrgIdListByRoleId(Long resRoleId) {
		// TODO Auto-generated method stub
		List<Long> idList=new ArrayList<Long>();
		QueryWrapper<ResRelRoleOrg> query=new QueryWrapper<ResRelRoleOrg>();
		query.eq("res_role_id", resRoleId);
		List<ResRelRoleOrg> relList=list(query);
		for(ResRelRoleOrg resRelRoleOrg:relList) {
			idList.add(resRelRoleOrg.getResOrgId2());
		}
		return idList;
	}
}